package com.heima.admin.service.impl;

import com.heima.admin.service.AdMediaReviewService;
import com.heima.apis.wemedia.IWemediaClient;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.NewsAuthDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AdMediaReviewServiceImpl implements AdMediaReviewService {

    @Autowired
    private IWemediaClient iWemediaClient;

    /**
     * 查询媒体审核列表
     *
     * @param dto
     * @return
     */
    @Override
    public ResponseResult findArticleList(NewsAuthDto dto) {
        PageResponseResult pageResponseResult = iWemediaClient.mediaReviewList(dto);
        ResponseResult responseResult = pageResponseResult;
        return responseResult;
    }

    /**
     * 媒体审核查看详情
     *
     * @param id
     * @return
     */
    @Override
    public ResponseResult findDetailById(Integer id) {
        ResponseResult responseResult = iWemediaClient.mediaDetail(id);
        return responseResult;
    }

    /**
     * 人工审核之拒绝
     *
     * @param dto
     * @return
     */
    @Override
    public ResponseResult authFail(NewsAuthDto dto) {
        ResponseResult responseResult = iWemediaClient.mediaAuthFail(dto);
        return responseResult;
    }

    /**
     * 人工审核之拒绝
     *
     * @param dto
     * @return
     */
    @Override
    public ResponseResult authPass(NewsAuthDto dto) {
        ResponseResult responseResult = iWemediaClient.mediaAuthPass(dto);
        return responseResult;
    }
}
